﻿using Bizall.Dynamic.Aspect;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using DynamicAspectTester.Mocks;

namespace DynamicAspectTester
{
    
    
    /// <summary>
    ///This is a test class for AspectBaseTest and is intended
    ///to contain all AspectBaseTest Unit Tests
    ///</summary>
    [TestClass()]
    public class AspectBaseTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        internal virtual AspectBase CreateAspectBase()
        {
            // TODO: Instantiate an appropriate concrete class.
            AspectBase target = null;
            return target;
        }

        /// <summary>
        ///A test for Enabled
        ///</summary>
        [TestMethod()]
        public void EnabledTest()
        {
            dynamic target = new TargetClass().AsDynamic();
            string expected = "I am here!";
            string actual = target.Greeting("s1", "s2");
            Assert.IsTrue(expected!=actual && actual!="s1s2");
        }

        /// <summary>
        ///A test for Sequence
        ///</summary>
        [TestMethod()]
        public void SequenceTest()
        {
            dynamic target = new TargetClass().AsDynamic();
            string expected = "MyAspect";
            string actual = target.Greeting("s1", "s2");
            Assert.AreEqual(expected, actual);
        }
    }
}
